<%--
  @author Supun Nimesh Karunathilaka
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<script type="text/javascript">
    $(document).ready(function() {
        $('.land-table').dataTable({

        });
    });
</script>

<div id="land-registration-module-home-title" class="module-home-title">
    <s:a href="searchModule.do"><img src="${pageContext.request.contextPath}/images/search.png"
                                     alt="Land Alienation"><span><s:label
            value="%{getText('search.label')}"/></span></s:a>
    <span class="module-title-breaker"> > </span>
    <s:a href="initViewAssociationList.do"><img
            src="${pageContext.request.contextPath}/images/searchLand.png"><span><s:label
            value="%{getText('search_lands_by_alienation.label')}"/></span></s:a>

    <div id="back-button" align="right">
            <s:form><s:submit value="%{getText('back_btn.label')}" action="initViewAssociationList"/></s:form>
    </div>
</div>

<s:if test="landAssociationList!=null">
    <table class="width-100 margin-10-auto table land-table">
        <thead>
        <tr class="left-align table-header">
            <th class=""><s:label value="%{getText('slmsSerialNumber.label')}"/></th>
            <th class=""><s:label value="%{getText('name_of_land.label')}"/></th>
            <th class=""><s:label value="%{getText('alienation_method.label')}"/></th>
            <th class=""><s:label value="%{getText('purpose.label')}"/></th>
            <th><s:label value="%{getText('status.label')}"/></th>
            <th><s:label value="%{getText('action.label')}"/></th>
        </tr>
        </thead>
        <tbody>
        <s:iterator status="status1" value="landAssociationList">
            <tr class="<s:if test="#status1.odd == true">able-row-odd</s:if><s:else>table-row-even</s:else>t">
                <td class="left-align"><s:property value="id"/></td>
                <td class="left-align"><s:property value="land.nameOfTheLand"/></td>
                <s:if test="language=='en'">
                    <td class="left-align"><s:property value="alienationMethod.enName"/></td>
                </s:if>
                <s:elseif test="language=='si'">
                    <td class="left-align"><s:property value="alienationMethod.siName"/></td>
                </s:elseif>
                <s:else>
                    <td class="left-align"><s:property value="alienationMethod.taName"/></td>
                </s:else>
                <td class="left-align"><s:property value="purpose"/></td>
                <td class="left-align"><s:property value="approvalState"/></td>
                <td class="left-align">
                    <s:url id="viewLandAssociationDetails" action="viewLandAssociationDetails">
                        <s:param name="landId" value="land.id"/>
                        <s:param name="metadataId" value="id"/>
                    </s:url>
                    <s:a href="%{viewLandAssociationDetails}">
                        <img src="<s:url value='/images/interest-party.png'/>" border="none" width="25"
                             height="25" title="View"/>
                    </s:a>
                </td>
            </tr>
        </s:iterator>
        </tbody>
    </table>
</s:if>
</div>

<s:hidden id="editMode" name="editMode"/>

